package com.aaa.controller;

import com.aaa.entity.LayData;
import com.aaa.entity.MyPage;
import com.aaa.entity.Tuku;
import com.aaa.service.TukuService;

import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("fangfa")
public class TukuController {

@Autowired
public TukuService service;

    @PostMapping("addUser")
    @ResponseBody
    public LayData insertUser(Tuku tuku){
        System.out.println("接手过来的参数是:"+tuku);
        boolean status=service.addUser(tuku);
        return new LayData(status);
    }
@PostMapping("updept")
@ResponseBody
public LayData updept(Tuku tuku){
        boolean sts=service.update(tuku);
        return new LayData(sts);
}
    @GetMapping("queryAll")
    @ResponseBody
    public LayData queryAll(MyPage myPage,Tuku tuku){
      PageInfo pageInfo=service.queryAll(myPage,tuku);
        return new LayData(pageInfo);
    }



}
